<?php

declare(strict_types=1);

namespace app\Common\service;

use app\Common\model\LongbingUserInfo;

class LongbingUserInfoService
{

    /**
     * @param $userId
     * @功能说明:获取员工姓名
     */
    public static function getNameByUserId($userId){
        $userInfo = new LongbingUserInfo();
        $name = $userInfo->where(['fans_id'=>$userId])->value('name');

        return $name;
    }

    /**
     * @param $userId
     * @功能说明:判断是否为员工
     */
    public static function isStraffByUserId($userId){

        $userInfo = new LongbingUserInfo();
        $is_staff = $userInfo->where(['fans_id'=>$userId])->value('is_staff');
        return $is_staff ? true : false ;
    }


}